<ul>
    <li><a href="/index/task1">Задача 1, 2</a></li>
</ul>
<table cellspacing="0" cellpadding="5" border="0">
    <tr>
        <td style="border: none">Всего: <?=count($this->users);?></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td><a href="<?=$this->url(array('controller'=>'index','action'=>'add'), null, false);?>">Добавить</a></td>
    </tr>
    <tr>
        <td style="border: black solid thin">Имя</td>
        <td style="border: black solid thin">Фамилия</td>
        <td style="border: black solid thin">Телефон</td>
        <td style="border: black solid thin">&nbsp;</td>
    </tr>
    <? foreach ($this->users as $user):
        $phone = $user->getPhone();
    ?>
        <tr>
            <td style="border: black solid thin"><?=$user->getFirstName();?></td>
            <td style="border: black solid thin"><?=$user->getLastName();?></td>
            <td style="border: black solid thin">
                <? echo (
                        is_null($phone['areanum'])
                        && is_null($phone['geonum'])
                        && is_null($phone['localnum'])
                        && is_null($phone['extnum'])
                        )
                    ? '&nbsp;'
                    : '+' . $phone['areanum']
                        . ' (' . $phone['geonum']
                        . ') ' . $phone['localnum']
                        . (is_null($phone['extnum']) ? '' : ' (доп. ' . $phone['extnum'] . ')');
                ?>
            </td>
            <td style="border: black solid thin"><a href="<?=$this->url(array('controller'=>'index','action'=>'edit', 'id' => $user->getId()), null, false);?>">Изменить</a></td>
        </tr>
    <? endforeach; ?>
</table>
